/*******************************************************

	Name : 
	ID : 
	College : College Of Science
	Type : HW1

*******************************************************/

# include <iostream>
# include <string>
# include <cmath>
# include <iomanip>
using namespace std;
int main()			// This is a program for three students to
						// calculate the averages and the mean and standard deviation of these averages.
{	
	double mt1,mt2,mt3;						// Midterm.
	double lt1,lt2,lt3;						// Laptest.
	double fl1,fl2,fl3;						// Final.
	double S;								// Standard Deviation
	double M;								// The mean.
	double avg1,avg2,avg3;					// Marks avreges.
	int id1,id2,id3;						// ID number.
	string student1,student2,student3;		// Students name.

			// First student.
	cout<<endl;
	cout<<"Please enter ID, Name, and marks( MT , LT & Final) of the First student:"<<endl;
	cin>>id1>>student1>>mt1>>lt1>>fl1;
	cout<<endl;

			// Second student.

	cout<<"Please enter ID, Name, and marks( MT , LT & Final) of the Second student:"<<endl;
	cin>>id2>>student2>>mt2>>lt2>>fl2;
	cout<<endl;

			// Third student.

	cout<<"Please enter ID, Name, and marks( MT , LT & Final) of the Third student:"<<endl;
	cin>>id3>>student3>>mt3>>lt3>>fl3;
	cout<<endl;

			// Calculate the Avreges for each student.

	avg1=(mt1+lt1+fl1)/3;
	avg2=(mt2+lt2+fl2)/3;
	avg3=(mt3+lt3+fl3)/3;

			// Calculate the Mean and the Standard Deviation.

	M=(avg1+avg2+avg3)/3;
	S=sqrt((pow((avg1-M),2)+pow((avg2-M),2)+pow((avg3-M),2))/2);
	
			// Display the calculation.

	cout  <<fixed<<showpoint;
	cout<<setw(6)<<"ID "<<setw(15)<<"student Name"<<setw(7)<<"LT"<<setw(7)<<"MT"<<setw(7)<<"FNL"<<setw(7)<<"AVG"<<endl;
	cout<<setw(6)<<"== "<<setw(15)<<"============"<<setw(7)<<"=="<<setw(7)<<"=="<<setw(7)<<"==="<<setw(7)<<"==="<<endl;
	cout<<setw(6)<<setprecision(2)<<id1<<setw(15)<<student1<<setw(7)<<lt1*1.00<<setw(7)<<mt1<<setw(7)<<fl1<<setw(7)<<avg1<<endl;
	cout<<setw(6)<<id2<<setw(15)<<student2<<setw(7)<<lt2<<setw(7)<<mt2<<setw(7)<<fl2<<setw(7)<<avg2<<endl;
	cout<<setw(6)<<id3<<setw(15)<<student3<<setw(7)<<lt3<<setw(7)<<mt3<<setw(7)<<fl3<<setw(7)<<avg3<<endl<<endl;

			// Display the Mean and the Standard Deviation.

	cout<<showpoint<<setprecision(2);
	cout<<"Mean=	"<<M<<endl;
	cout<<"STD=	"<<S<<endl<<endl;


	return 0;
}
